package com.goodmr.passport.webapp.exception;

import com.goodmr.passport.webapp.enums.ErrorEnum;
import lombok.Getter;

/**
 * Http 请求异常
 *
 * @author <a href="mailto:bingdong13@msn.com">bigo</a>
 */
@Getter
class HttpException extends RuntimeException {

    private static final long serialVersionUID = -6351139193378479081L;

    private int code;

    private ErrorEnum error;

    HttpException(int code, String message, Throwable cause) {
        super(message, cause);

        this.code = code;
    }

    HttpException(ErrorEnum error, Throwable cause) {
        super(error.getResource(), cause);

        this.error = error;
    }

    HttpException(ErrorEnum error) {
        super(error.getResource());

        this.error = error;
    }
}
